home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / comm / cnet / time_clock.lha / timerclock / TimeClockE < prev    next >
Text File  |  1997-03-13  |  8KB  |  125 lines

  1. /**************************************************************************\
  2.    $VER: TimeClock Extension, v2.00 (14-Mar-97) by Dotoran of Frontiers!
  3. \**************************************************************************/
  4. options results;signal on SYNTAX;signal on ERROR;signal on IOERR
  5. a=sourceline(2);parse var a . ", "ver" ("vdate")" .
  6. tr=transmit;se=sendstring;gc=getchar;gu=getuser
  7. a="rexxsupport.library";if ~show("l",a) then if ~addlib(a,0,-30) then exit
  8. parse source . . fp .;df=left(fp,max(lastpos('/',fp),lastpos(':',fp)))
  9.  
  10. parse arg arg ; gu 1109799 ; quick=result ; gu 1100453 ; tf=result
  11. if quick then do;setobject "0";putuser 1109799;end
  12.  
  13. if arg>"" then tr "n1cbTime Clock ceExtensionsc9:"
  14. path=df;gu 23;port=result;gu 40;id=result
  15. if arg="C" then do;a="C";signal CDTIMER;end
  16. if arg="T" then do;a="T";signal TDTIMER;end
  17. se "n1c6Set c7<cbCc7>cbountc6-cbDown c9Timerc6, c7<caTc7>caimec6-caOfc6-caDay c9Timerc6, or cf[cdQUITcf]c9: "
  18. gc;a=result;if index("CT",a)=0 then do ; tr "cdQuit" ; exit ; end
  19.  
  20. CDTIMER:
  21. if a="C" then do ; tr "cbCountc6-cbDown c9Timer";tc=getclip("CDtimer"id)
  22.   if tc>"" then do ; parse var tc v1 v2 v3 v4 v5 v;v6=strip(v)
  23.     tr "n1   c6You already have a cd`cbcount downcd' c9timer c6set:n1"
  24.     tr "Cr1cb Set Forr0c9: ce"v5" c6minutes.";if v6="" then v6="c9Not c6defined."
  25.     tr "Cr1cb  Set Atr0c9: ca"v4
  26.     se "Cr1cbReminderr0c9: cd"v6"n2c6Want to c9cancel c6this timer? c7[caNoc7]c9: ca"
  27.     gc;a=result;if a="Y" then do;tr "Yes";call setclip("CDtimer"id)
  28.       tr "n1c6Your cd`cbcount downcd' c9timer c6setting has been cccanceledc6!"
  29.       a="C";signal CDTIMER2;end
  30.     tr "No.";exit;end
  31.   gu 7 ; ti=result%10 ; if quick then signal CDTIMER2
  32.   se "n1caView ceHelp c6now? c7[caNoc7]c9: ca";gc;a=result
  33.   if a="Y" then do ; tr "Yes"
  34.     se "n1   c6You have ca"ti" minutes c6remaining this call. It is possible for "
  35.     se "you to create a c9timer c6which can cd`cbcount downcd' c6a specified number of "
  36.     se "minutes. For instance, if you're going to dinner in cf1/2 c6an hour, you "
  37.     se "can set a cd`cbcount downcd' c9timer c6for ce25 minutesc6. You then go about your "
  38.     se "business, and at the c9end c6of the ce25 minute c6period, a cfSystem OnLine "
  39.     se "Message c6(also referred to as an cfOLMc6) will be sent to you alerting you "
  40.     se "that the specified time has elapsed. Additionally, you can supply a "
  41.     tr "line of cd`caremindercd' c6text which will caALSO c6appear in the cfOLMc6.n1"
  42.     se "c6   The c9timer c6will caremain activec6, even if you c9lose carrier c6or celog offc6. "
  43.     se "If you logon to cfANY c6port before the c9timer c6has cd`catimed-outcd' c6you'll still "
  44.     se "be alerted that the c9timer c6has gone off. Remember, however, that the "
  45.     se "timer uses cfOLM's c6to alert you. There are areas within the bbs that "
  46.     se "c9restrict c6an cfOLM's c6ability to display, until such a time as you leave "
  47.     se "that area. For instance, many of the online games, like cbWheel of "
  48.     se "Fortunec6, can cfMUFFLE c6ports, which means you will c9NOT c6be shown cfOLM's "
  49.     tr "c6for the amount of time spent inside the game." ; end
  50.   else tr "No"
  51. CDTIMER2:
  52.   gu 7 ; ti=result%10
  53.   se "n1c6Set cd`cbCount-Downcd' c9timer c6for how many minutes? c7(ce1c7-ce"ti"c7/cf[cdQuitcf]c7)c9: cesI0 3}"
  54.   gu 70;tl=result;if tl<1 | tl>ti then do;tr "ucdQuit";exit;end
  55.   tr "n1caCreate c6reminder text below. c7(c6Press cbENTERc7/cbRETURN c6to c9NOT c6create reminderc7)c9:"
  56.   se "cf> car1I0 77}r0";gu 70;rt=result;if rt="" then tr "n1c9No c6reminder text will be used."
  57.   tr "n1   c6In ca"tl" minutesc6, I'll send you an cfOLMc6. cbThanks c6for using c9Timerc6!"
  58.   timer=port" "id" 1 "left(time("n"),5)" "tl" "rt
  59.   call setclip("CDtimer"id,timer);signal START
  60.  end
  61.  
  62. TDTIMER:
  63. if a="T" then do ; tr "caTimec6-caOfc6-caDay c9Timer";tc=getclip("TDtimer"id)
  64.   if tc>"" then do ; parse var tc v1 v2 v3 v4 v5 v;v6=strip(v)
  65.     tr "n1   c6You already have a cd`catime of daycd' c9timer c6set:n1"
  66.     t=left(v5,2)":"right(v5,2);if length(v5)=3 then t=left(v5,1)":"right(v5,2)
  67.     tr "Cr1ca Set Forr0c9: ce"t;if v6="" then v6="c9Not c6defined."
  68.     tr "Cr1ca  Set Atr0c9: ca"v4
  69.     se "Cr1caReminderr0c9: cd"v6"n2c6Want to c9cancel c6this timer? c7[caNoc7]c9: ca";gc
  70.     a=result;if a="Y" then do;tr "Yes";call setclip("TDtimer"id)
  71.       tr "n1c6Your cd`catime of daycd' c9timer c6setting has been c9canceledc6!"
  72.       a="T";signal TDTIMER2;end
  73.     tr "No.";exit;end
  74.   gu 7 ; ti=result%10 ; if quick then signal TDTIMER2
  75.   se "n1caView ceHelp c6now? c7[ceNoc7]c9: ce";gc;a=result
  76.   if a="Y" then do ; tr "Yes"
  77.     se "@4n1   c6It is now ca"left(time("n"),5)"c6. I can alert you when the "
  78.     se "specified cd`catime of daycd' c6has occurred. For instance, if you logon "
  79.     se "at cf1:00PMc6, but need to mow the lawn at cf1:30PMc6, you can have this "
  80.     se "c9timer c6alert you when cf1:30PM c6comes alongc7(c6just like an c9alarm clockc6!c7)c6. "
  81.     se "You can additionally create a cd`cbremindercd' c6text, which will also "
  82.     se "appear in the cfOLM c7(cfOn Line Messagec7) c6that is used to alert you the "
  83.     tr "specified time has come.n1"
  84.     se "c6   The c9timer c6will caremain activec6, even if you c9lose carrier c6or celog offc6. "
  85.     se "If you logon to cfANY c6port before the c9timer c6has cd`catimed-outcd' c6you'll still "
  86.     se "be alerted that the c9timer c6has gone off. Remember, however, that the "
  87.     se "timer uses cfOLM's c6to alert you. There are areas within the bbs that "
  88.     se "c9restrict c6an cfOLM's c6ability to display, until such a time as you leave "
  89.     se "that area. For instance, many of the online games, like cbWheel of "
  90.     se "Fortunec6, can cfMUFFLE c6ports, which means you will c9NOT c6be shown cfOLM's "
  91.     tr "c6for the amount of time spent inside the game.n1"
  92.     if ~tf then do
  93.       tr "ca13:00 - 1 PM     16:00 - 4PM     19:00 - 7PM     22:00 - 10PM"
  94.       tr "cd14:00 - 2 PM     17:00 - 5PM     20:00 - 8PM     23:00 - 11PM"
  95.       tr "ca15:00 - 3 PM     18:00 - 6PM     21:00 - 9PM     00:00 - 12AM (Midnight)"
  96.     end
  97.   end
  98.   else tr "No"
  99. TDTIMER2:
  100.   se "n1c6It is now ca"left(time("n"),5)"c6. c6Using cf24-Hour c6time format, set the cd`caTimec6-caOfc6-caDaycd' c6timer to alert "
  101.   se "you at what time? c7(ce00:00c7-ce23:59c7/cf[cdQuitcf]c7)c9: cesI0 5}";gu 70;tl=compress(result,":")
  102.   if tl<"0000" | tl>"2359" then do ; tr "ucdQuit" ; exit ; end 
  103.   tr "n1caCreate c6reminder text below. c7(c6Press caENTERc7/caRETURN c6to c9NOT c6create reminderc7)c9:"
  104.   se "cf> cbr1I0 77}r0";gu 70;rt=result;if rt="" then tr "n1c9No c6reminder text will be used."
  105.   t=left(tl,2)":"right(tl,2);if length(tl)=3 then t=left(tl,1)":"right(tl,2)
  106.   tr "n1   c6At ca"t"c6, I'll send you an cfOLMc6. cbThanks c6for using c9Timerc6!"
  107.   timer=port" "id" 2 "left(time("n"),5)" "tl" "rt
  108.   call setclip("TDtimer"id,timer);signal START
  109.  end
  110.  
  111. START:
  112.   address command "run >nil: rx "path"TimeClockT "timer
  113.  
  114. exit
  115. CHECK:;if ARG() & ARG(1)~="###PANIC" then return ARG(1)
  116.   getcarrier;if result="TRUE" then if ARG() then return ARG(1);else return
  117.   logentry "Lost Carrier!!";bufferflush;exit
  118. SYNTAX:;ERROR:;IOERR:;e1="n1 Error: "rc" ("errortext(rc)")"
  119.   e2="  Line: "left(sigl,4)"File:";c="`"fp", "ver"'";e2=e2" "c;tr e1;tr e2
  120.   logentry e1;logentry e2;e=strip(translate(sourceline(sigl),"\{",""))
  121.   do while e~="";e3="Source: "left(e,37);tr e3;logentry e3;e=substr(e,38);end
  122.   bufferflush
  123. /**************************************************************************\
  124. \****************************************** Frontiers BBS (716)/823-9892 **/
  125.